For a quick start, see NNNNOOOOTTTTEEEESSSS at the end.
PPPPrrrrooooccccmmmmaaaaiiiillll should be invoked automatically over the ....ffffoooorrrrwwwwaaaarrrrdddd
file mechanism as soon as mail arrives. Alternatively, when
installed by a system administrator, it can be invoked from
within the mailer immediately. When invoked, it first sets
some environment variables to default values, reads the mail
message from stdin until an EOF, separates the body from the
header, and then, if no command line arguments are present,
it starts to look for a file named $$$$HHHHOOOOMMMMEEEE////....pppprrrrooooccccmmmmaaaaiiiillllrrrrcccc.
According to the processing recipes in this file, the mail
message that just arrived gets distributed into the right
folder (and more). If no rcfile is found, or processing of
the rcfile falls off the end, procmail will store the mail
in the default system mailbox.
If no rcfiles and no ----pppp have been specified on the command
line, procmail will, prior to reading $HOME/.procmailrc,
interpret commands from
////uuuussssrrrr////ffffrrrreeeeeeeewwwwaaaarrrreeee////lllliiiibbbb////pppprrrrooooccccmmmmaaaaiiiillll////pppprrrrooooccccmmmmaaaaiiiillllrrrrcccc (if present). Care
must be taken when creating
/usr/freeware/lib/procmail/procmailrc, because, if
circumstances permit, it will be executed with root
privileges (contrary to the $HOME/.procmailrc file of
course).
If running suid root or with root privileges, procmail will
be able to perform as a functionally enhanced, backwards
compatible mail delivery agent.
Procmail can also be used as a general purpose mail filter,
i.e. provisions have been made to enable procmail to be
invoked in a special sendmail rule.
The rcfile format is described in detail in the
pppprrrrooooccccmmmmaaaaiiiillllrrrrcccc(5) man page.
The weighted scoring technique is described in detail in the
pppprrrrooooccccmmmmaaaaiiiillllsssscccc(5) man page.
This will set $1 to be equal to _a_r_g_u_m_e_n_t. It can be
used to pass meta information along to procmail. This
is typically done by passing along the $@x information
from the sendmail mailer rule.
----dddd _r_e_c_i_p_i_e_n_t ...
This turns on explicit delivery mode, delivery will be
to the local user _r_e_c_i_p_i_e_n_t. This, of course, only is
possible if procmail has root privileges (or if
procmail is already running with the recipient's euid
and egid). Procmail will setuid to the intended
recipients and delivers the mail as if it were invoked
by the recipient with no arguments (i.e. if no rcfile
is found, delivery is like ordinary mail). This option
is incompatible with ----pppp.
----mmmm Turns procmail into a general purpose mail filter. In
this mode one rcfile must be specified on the command
line. After the rcfile, procmail will accept an
unlimited number of arguments. If the rcfile is an
absolute path starting with
////uuuussssrrrr////ffffrrrreeeeeeeewwwwaaaarrrreeee////lllliiiibbbb////pppprrrrooooccccmmmmaaaaiiiillll////pppprrrrooooccccmmmmaaaaiiiillllrrrrccccssss//// without
backward references (i.e. the parent directory cannot
be mentioned) procmail will, only if no security
violations are found, take on the identity of the owner
of the rcfile (or symbolic link). For some advanced
usage of this option you should look in the EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
section below.
AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
Any arguments containing an '=' are considered to be
environment variable assignments, they will _a_l_l be evaluated
after the default values have been assigned and before the
first rcfile is opened.
Any other arguments are presumed to be rcfile paths (either
absolute, or if they start with `./' relative to the current
directory; aaaannnnyyyy ooootttthhhheeeerrrr rrrreeeellllaaaattttiiiivvvveeee path is relative to $HOME,
unless the ----mmmm option has been given, in which case all
relative paths are relative to the current directory);
procmail will start with the first one it finds on the
command line. The following ones will only be parsed if the
preceding ones have a not matching HOST-directive entry, or
Linking to "x" Creating a hardlink between directory
folders.
Match on "x" Condition matched.
Matched "x" Assigned "x" to MMMMAAAATTTTCCCCHHHH.
No match on "x" Condition didn't match, recipe
skipped.
Notified comsat: "$LOGNAME@offset:file"
Sent comsat/biff a notice that mail
arrived for user $LOGNAME at `offset'
in `file'.
Opening "x" Opening file "x" for appending.
Rcfile: "x" Rcfile changed to "x".
Reiterating kernel-lock
While attempting several locking
methods, one of these failed. Proc-
mail will reiterate until they all
succeed in rapid succession.
Score: added newtotal "x"
This condition scored `added' points,
which resulted in a `newtotal' score.
Unlocking "x" Removing lockfile "x" again.
WWWWAAAARRRRNNNNIIIINNNNGGGGSSSS
You should create a shell script that uses lllloooocccckkkkffffiiiilllleeee(1) be-
fore invoking your mail shell on any mailbox file other than
the system mailbox (unless of course, your mail shell uses
the same lockfiles (local or global) you specified in your
rcfile).
In the unlikely event that you absolutely need to kill proc-
mail before it has finished, first try and use the regular
kill command (i.e. _n_o_t kill -9, see the subsection _S_i_g_n_a_l_s
for suggestions), otherwise some _l_o_c_k_f_i_l_e_s might not get re-
moved.
Beware when using the ----tttt option, if procmail repeatedly is
unable to deliver the mail (e.g. due to an incorrect
rcfile), the system mailqueue could fill up. This could ag-
gravate both the local postmaster and other users.
The ////uuuussssrrrr////ffffrrrreeeeeeeewwwwaaaarrrreeee////lllliiiibbbb////pppprrrrooooccccmmmmaaaaiiiillll////pppprrrrooooccccmmmmaaaaiiiillllrrrrcccc file might be exe-
cuted with root privileges, so be very careful of what you
put in it. SSSSHHHHEEEELLLLLLLL will be equal to that of the current reci-
pient, so if procmail has to invoke the shell, you'd better
set it to some safe value first. See also: DDDDRRRROOOOPPPPPPPPRRRRIIIIVVVVSSSS.
Keep in mind that if cccchhhhoooowwwwnnnn(1) is permitted on files in
////uuuussssrrrr////ffffrrrreeeeeeeewwwwaaaarrrreeee////lllliiiibbbb////pppprrrrooooccccmmmmaaaaiiiillll////pppprrrrooooccccmmmmaaaaiiiillllrrrrccccssss////, that they can be
chowned to root (or anyone else) by their current owners.
For maximum security, make sure this directory is _e_x_e_c_u_t_a_b_l_e
to root only.
BBBBUUUUGGGGSSSS
After removing a lockfile by force, procmail waits $SUSPEND
seconds before creating a new lockfile so that another pro-
cess that decides to remove the stale lockfile will not re-
move the newly created lock by mistake.
Procmail uses the regular TERMINATE signal to terminate any
runaway filter, but it does not check if the filter responds
to that signal and it only sends it to the filter itself,
not to any of the filter's children.
A continued CCCCoooonnnntttteeeennnntttt----LLLLeeeennnnggggtttthhhh:::: field is not handled correctly.
MAILDIR=$HOME/Mail #you'd better make sure it exists
DEFAULT=$MAILDIR/mbox #completely optional
LOGFILE=$MAILDIR/from #recommended
:0:
* ^From.*berg
from_me
:0
* ^Subject:.*Flame
/dev/null
Other examples for rcfile recipes can be looked up in the
pppprrrrooooccccmmmmaaaaiiiilllleeeexxxx(5) man page.
SSSSOOOOUUUURRRRCCCCEEEE
This program is part of the _p_r_o_c_m_a_i_l _m_a_i_l-_p_r_o_c_e_s_s_i_n_g-_p_a_c_k_a_g_e
(v3.11pre7 1997/04/28) available at your nearest USENET
comp.sources.misc archive, or at ftp.informatik.rwth-
aachen.de as ppppuuuubbbb////ppppaaaacccckkkkaaaaggggeeeessss////pppprrrrooooccccmmmmaaaaiiiillll////pppprrrrooooccccmmmmaaaaiiiillll....ttttaaaarrrr....ggggzzzz.
MMMMAAAAIIIILLLLIIIINNNNGGGGLLLLIIIISSSSTTTT
There exists a mailinglist for questions relating to any
program in the procmail package:
<procmail@informatik.rwth-aachen.de>
for submitting questions/answers.
<procmail-request@informatik.rwth-aachen.de>
for subscription requests.
If you would like to stay informed about new versions and